package com.wkn.wknAdmin.exception;

import com.wkn.wknAdmin.result.ResultCode;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Title:
 * @Description: 自定义异常
 * @Author: WKN
 * CreateDate: 2022/7/25 11:29
 */
@Getter
@AllArgsConstructor
public class APIException extends RuntimeException {

    private int code;
    private String msg;

    public APIException() {
        this(ResultCode.FAILED);
    }

    public APIException(ResultCode failed) {
        this.code=failed.getCode();
        this.msg=failed.getMsg();
    }

}
